package cn.itsource.hrm.controller;

import cn.itsource.hrm.domain.User;
import cn.itsource.hrm.util.AjaxResult;
import org.springframework.web.bind.annotation.*;

/**
 * @author jinhui
 * @version V1.0.0
 * @date 2020/5/20
 */
@RestController
public class UserController {
    @PostMapping("/login")
    public AjaxResult loggin(@RequestBody User user){
        if ("admin".equals(user.getUsername())&&"admin".equals(user.getPassword())){
            return AjaxResult.me().setSuccess(true).setMessage("登入成功").setResultObj(user);
        }else {
            return AjaxResult.me().setSuccess(false).setMessage("账号或密码错误");
        }

    }
}
